﻿using EasyERP_View.FrmBase;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;

namespace EasyERP_View
{
    /// <summary>
    /// 程序主窗体
    /// </summary>
    public partial class FrmMain : Form
    {
        /// <summary>
        /// 声明主窗体实例
        /// </summary>
        public static FrmMain instance;

        public static string user_cd = "admin";

        #region 构造函数
        /// <summary>
        /// 构造函数
        /// </summary>
        public FrmMain()
        {
            InitializeComponent();
            instance = this;        //将窗体赋值给实例
        }
        #endregion

        #region 程序加载事件
        /// <summary>
        /// 程序加载事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmMain_Load(object sender, EventArgs e)
        {
            //加载home页
            FrmHomePage homePage = new FrmHomePage();
            homePage.Show(dockPanelMain);

            //加载菜单栏
            FrmMenu frmMenu = new FrmMenu();
            frmMenu.Show(dockPanelMain, DockState.DockLeft);        //将菜单栏停靠在左侧
            dockPanelMain.DockLeftPortion = 160;                    //设置菜单栏宽度

            tssl_User.Text += user_cd;
            tssl_Date.Text += DateTime.Now.ToString("yyyy-MM-dd");
        }
        #endregion
    }
}
